package process_control;

import java.util.Scanner;

public class DeadLoopDemo {
    public static void main(String[] args) {
        // 死循环
//        for(; ;){
            // 这是死循环
//        }
//        do {
//            //这也是死循环
//        }while(true);
        Scanner sc = new Scanner(System.in);
        while(true){
            //死循环
            System.out.println("请输入1+1的结果：");
            int re = sc.nextInt();
            if(re == 2){
                System.out.println("答案正确！");
                break;
            }
            else System.out.println("答案错误！");
        }
    }
}
